ServiceNow inbound field rule for Configuration Items

Hello,

I would like to create an inbound field rule for the ServiceNow field Configuration Item (cmdb_ci). I understand from the product documentation that I can set it from the payload, but I can’t find anything close to a CI field there. The documentation references 2 examples rules available with the base installation, once of which uses “log_entries.channel.details.ci” (judging by the screenshot) but I don’t see “details.ci” in any of the payloads.
I’m sure there’s something I am missing here. Any suggestion would be greatly appreciated.

Knowledge Source: https://support.pagerduty.com/docs/advanced-servicenow-configuration#inbound-field-rules

You would use any of the available metadata arriving in the incident.trigger (in most cases) or other webhook type, extract the fields/values needed, and then use that to perform a glide record lookup to get the sys_id value to use in updating the incident field. You might need many IFR rules based on the incoming event/alert and incidents from PagerDuty.

In most cases, we’d hope to see a host/node name, ip address, or similar metadata in the webhook coming from your monitoring tool --> PagerDuty alert/incident and then be able to do the lookup and match against a CMDB CI record. If you had an IP address in your event/alert data, you’d configure the IFR to use that field in the webhook JSON like log_entries.channel.details.PATH.TO.IP_ADDRESS.

This would pass the value into the script where we do a Glide Record query to find a matching ip_address in the CMDB and return the sys_id and map into the Configuration Item field on the incident.

var gr=new GlideRecord("cmdb_ci"); 
gr.addQuery("ip_address", value); 
gr.query(); 
if (gr.next()) { 
	result = gr.getValue("sys_id"); 
}
1 Like